package cn.aifeix.fallback;

import cn.aifeix.domain.User;
import cn.aifeix.feign.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServiceFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User getUserById(Long id) {
                return  new User(-1L,"熔断了","熔断了，别搞了");
            }
        };
    }
}
